package com.bulletphysics.gwt.client.util;

import com.bulletphysics.gwt.client.collision.broadphase.BroadphasePair;
import com.bulletphysics.gwt.client.collision.dispatch.CompoundCollisionAlgorithm;
import com.bulletphysics.gwt.client.collision.dispatch.ConvexConcaveCollisionAlgorithm;
import com.bulletphysics.gwt.client.collision.dispatch.ConvexConvexAlgorithm;
import com.bulletphysics.gwt.client.collision.dispatch.ConvexPlaneCollisionAlgorithm;
import com.bulletphysics.gwt.client.collision.dispatch.SphereSphereCollisionAlgorithm;
import com.bulletphysics.gwt.client.collision.dispatch.UnionFind.Element;
import com.bulletphysics.gwt.client.collision.narrowphase.ManifoldPoint;
import com.bulletphysics.gwt.client.collision.narrowphase.PersistentManifold;
import com.bulletphysics.gwt.client.collision.narrowphase.DiscreteCollisionDetectorInterface.ClosestPointInput;
import com.bulletphysics.gwt.client.collision.narrowphase.GjkEpaSolver.Face;
import com.bulletphysics.gwt.client.collision.narrowphase.GjkEpaSolver.He;
import com.bulletphysics.gwt.client.collision.narrowphase.GjkEpaSolver.Mkv;
import com.bulletphysics.gwt.client.collision.narrowphase.VoronoiSimplexSolver.SubSimplexClosestResult;
import com.bulletphysics.gwt.client.collision.shapes.OptimizedBvhNode;
import com.bulletphysics.gwt.client.collision.shapes.BvhTriangleMeshShape.MyNodeOverlapCallback;
import com.bulletphysics.gwt.client.dynamics.constraintsolver.JacobianEntry;
import com.bulletphysics.gwt.client.dynamics.constraintsolver.SolverBody;
import com.bulletphysics.gwt.client.dynamics.constraintsolver.SolverConstraint;
import com.bulletphysics.gwt.client.extras.gimpact.GImpactCollisionAlgorithm;
import com.bulletphysics.gwt.client.linearmath.convexhull.Tri;
import com.bulletphysics.gwt.client.vecmath.Vector3f;

public class FactoriesHelper {

	public static ObjectFactory<CompoundCollisionAlgorithm> compoundCollisionAlgorithmFactory = new ObjectFactory<CompoundCollisionAlgorithm>() {
		public CompoundCollisionAlgorithm create() {
			return new CompoundCollisionAlgorithm();
		};
	};
	
	public static ObjectFactory<PersistentManifold> persistentManifoldFactory = new ObjectFactory<PersistentManifold>() {
		@Override
		public PersistentManifold create() {
			return new PersistentManifold();
		}
	};
	
	public static ObjectFactory<BroadphasePair> broadphasePairFactory = new ObjectFactory<BroadphasePair>() {
		@Override
		public BroadphasePair create() {
			return new BroadphasePair();
		}
	};
	
	public static ObjectFactory<ConvexConcaveCollisionAlgorithm> convexConcaveCollisionAlgorithmFactory = new ObjectFactory<ConvexConcaveCollisionAlgorithm>() {
		@Override
		public ConvexConcaveCollisionAlgorithm create() {
			return new ConvexConcaveCollisionAlgorithm();
		}
	};
	
	public static ObjectFactory<ClosestPointInput> closestPointInputFactory = new ObjectFactory<ClosestPointInput>() {
		@Override
		public ClosestPointInput create() {
			return new ClosestPointInput();
		}
	};
	
	public static ObjectFactory<ConvexConvexAlgorithm> convexConvexAlgorithmFactory = new ObjectFactory<ConvexConvexAlgorithm>() {
		@Override
		public ConvexConvexAlgorithm create() {
			return new ConvexConvexAlgorithm();
		}
	};
	
	public static ObjectFactory<ConvexPlaneCollisionAlgorithm> convexPlaneCollisionAlgorithmFactory = new ObjectFactory<ConvexPlaneCollisionAlgorithm>() {
		@Override
		public ConvexPlaneCollisionAlgorithm create() {
			return new ConvexPlaneCollisionAlgorithm();
		}
	};
	
	public static ObjectFactory<ManifoldPoint> manifoldPointFactory = new ObjectFactory<ManifoldPoint>() {
		@Override
		public ManifoldPoint create() {
			return new ManifoldPoint();
		}
	};
	
	public static ObjectFactory<SphereSphereCollisionAlgorithm> sphereSphereCollisionAlgorithmFactory = new ObjectFactory<SphereSphereCollisionAlgorithm>() {
		@Override
		public SphereSphereCollisionAlgorithm create() {
			return new SphereSphereCollisionAlgorithm();
		}
	};
	
	public static ObjectFactory<Mkv> mkvFactory = new ObjectFactory<Mkv>() {
		@Override
		public Mkv create() {
			return new Mkv();
		}
	};

	public static ObjectFactory<He> heFactory = new ObjectFactory<He>() {
		@Override
		public He create() {
			return new He();
		}
	};

	public static ObjectFactory<Face> faceFactory = new ObjectFactory<Face>() {
		@Override
		public Face create() {
			return new Face();
		}
	};

	public static ObjectFactory<SubSimplexClosestResult> subSimplexClosestResultFactory = new ObjectFactory<SubSimplexClosestResult>() {
		@Override
		public SubSimplexClosestResult create() {
			return new SubSimplexClosestResult();
		}
	};

	public static ObjectFactory<MyNodeOverlapCallback> myNodeOverlapCallbackFactory = new ObjectFactory<MyNodeOverlapCallback>() {
		@Override
		public MyNodeOverlapCallback create() {
			return new MyNodeOverlapCallback();
		}
	};

	public static ObjectFactory<JacobianEntry> jacobianEntryFactory = new ObjectFactory<JacobianEntry>() {
		@Override
		public JacobianEntry create() {
			return new JacobianEntry();
		}
	};

	public static ObjectFactory<SolverBody> solverBodyFactory = new ObjectFactory<SolverBody>() {
		@Override
		public SolverBody create() {
			return new SolverBody();
		}
	};

	public static ObjectFactory<SolverConstraint> solverConstraintFactory = new ObjectFactory<SolverConstraint>() {
		@Override
		public SolverConstraint create() {
			return new SolverConstraint();
		}
	};

	public static ObjectFactory<GImpactCollisionAlgorithm> gImpactCollisionAlgorithmFactory = new ObjectFactory<GImpactCollisionAlgorithm>() {
		@Override
		public GImpactCollisionAlgorithm create() {
			return new GImpactCollisionAlgorithm();
		}
	};

	public static ObjectFactory<Vector3f> vector3fFactory = new ObjectFactory<Vector3f>() {
		@Override
		public Vector3f create() {
			return new Vector3f();
		}
	};

	public static ObjectFactory<Tri> triFactory = new ObjectFactory<Tri>() {
		@Override
		public Tri create() {
			return new Tri();
		}
	};

	public static ObjectFactory<OptimizedBvhNode> optimizedBvhNodeFactory = new ObjectFactory<OptimizedBvhNode>() {
		@Override
		public OptimizedBvhNode create() {
			return new OptimizedBvhNode();
		}
	};

	public static ObjectFactory<Element> elementFactory = new ObjectFactory<Element>() {
		@Override
		public Element create() {
			return new Element();
		}
	};
}
